#!/usr/bin/env bash
# SPDX-License-Identifier: BSD-3-Clause
# Copyright 2017-2019, Intel Corporation

#
# src/test/blk_rw/TEST12 -- unit test for pmemblk_read/write/set_zero/set_error
#
# Same as TEST10, but run on a pool set that spans two Device DAX devices
# with 2M alignment. Expected failure, as 2M alignment is not supported
# if NODHRS option is not specified.
#

. ../unittest/unittest.sh

require_test_type medium
require_fs_type any
require_dax_device_alignments 2097152 2097152 # 2MiB

setup

dax_device_zero

create_poolset $DIR/testset AUTO:${DEVICE_DAX_PATH[0]} AUTO:${DEVICE_DAX_PATH[1]}

expect_abnormal_exit ./blk_rw$EXESUFFIX 512 $DIR/testset c\
	r:0 r:1 r:32201 r:32313 z:0 z:1 r:0

pass
